import sheep from '@/sheep';
import { formatImageUrlProtocol } from './index';

const agency  = (poster) => {
    const width = poster.width;
    const userInfo = sheep.$store('user').userInfo;

    return {
        background: formatImageUrlProtocol(sheep.$url.cdn(sheep.$store('app').platform.share.posterInfo.invite_agent)),
        list: [
        // #ifndef MP-WEIXIN
        {
            name: 'qrcode',
            type: 'qrcode',
            val: poster.shareInfo.link,
            x: width * 0.75,
            y: width * 1.3,
            size: width * 0.2,
        },
        // #endif
        // #ifdef MP-WEIXIN
        {
            name: 'wxacode',
            type: 'image',
            val: sheep.$api.third.wechat.getWxacode(poster.shareInfo.path),
            x: width * 0.33,
            y: width * 0.73,
            width: width * 0.35,
            height: width * 0.35,
        },
        // #endif
        ],
    };
};

export default agency;
